home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp48hor1
/
mapd.doc
< prev
next >
Wrap
Text File
|
1995-03-31
|
2KB
|
61 lines
(Comp.sys.handhelds)
Item: 3947 by _sun1 at hpcvbbs.cv.hp.com
Author: Scott Ferry (415) 845-1088
Subj: USA GROB (huge) w/ latitude/longitude output
Date: Sat Sep 07 1991
(Donated to Goodies Disk Project at the Corvallis Conference 8/4/91)
[Note: MAPD is over 14K long. See MAPD2.DOC for a way to to run MAPD
in only 5K. -jkh-]
MAPD is a directory containing:
MAP
USGROB
MAPX
FIX2
The program `MAP' runs the whole thing. When you run it, it
calls up USGROB, a huge (424x262) GROB of the 48 contiguous United
States. Scroll around (using the arrow keys and blue shift)
until you get the part of the country you're interested in, then
press [left-shift] GRAPH. The cross-cursor appears. Now move that
around until you get it directly over the place you're interested in
and press [ENTER] followed by [ATTN]. The longitude and latitude
will appear on the stack, tagged. (Accuracy about 1/2 degrees).
`MAP' is written in system RPL and mainly puts the GROB into
PICT, etc., sets up the PPAR, and then lastly calls `MAPX'. This
routine is a small part of a 51K library I wrote that does a lot
of stuff and is intended for a 128K ROM card. Since there will be
plenty of space on the card I didn't use PGROB and UPGROB [by Erik
Bryntse; see PGROB.DOC on this disk. -jkh-] in the interest of time
and safety. But it is certainly amenable to these programs (it
cuts the size in half).
`MAPX' does the conversion from user coordinates to latitude
and longitude, and is written in user RPL, this being plenty fast
enough. I basically figured it out by some math and a lot of
trial and error, so it will, perhaps obviously, not work with
any other map.
`MAPX' calls `FIX2', a system RPL program to properly round
an HMS format number to 2 decimal places. E.g.:
15 35' 34.2" => 15.35342 -> 15.36
15 35' 30" => 15.353 -> 15.35
15 35' 29.9" => 15.35299 -> 15.35
15 59' 30" => 15.593 -> 16
and similarly for negative values.
Make sure you have a real number on the stack if you call
the program alone.
These programs are copyrighted, but may be used in any non-commercial,
non-astronomy related program without further permission needed.
They were written and tested on a Version E machine.
Good Luck, Scott